package com.qingke.memo.command.system;

import com.qingke.memo.command.SystemCommand;
import com.qingke.memo.pojo.Memo;
import com.qingke.memo.unit.MConsole;

public class SelectMemoById extends SystemCommand{

	@Override
	public void execute() {
		int id=MConsole.getInt("memo id:");
		if(!dao.isMemoExistById(id)){
			MConsole.println("the memo is not existed.");
			return ;
		}
		Memo memo=dao.selectMemoById(id);
		MConsole.println("------------------------------------");
		MConsole.println("title:"+memo.getTitle());
		MConsole.println("create time:"+memo.getCreateTime());
		MConsole.println("content:"+memo.getContent());
		MConsole.println("------------------------------------");
	}

}
